#pragma once
#include <boost/test/included/unit_test.hpp>
#include <fmt/fmt.h>
#include "../include/sh/time.hpp"
#include "../include/sh/algorithm.hpp"
#include "../include/sh/signal.hpp"

BOOST_AUTO_TEST_SUITE(SIGNAL_TEST)

BOOST_AUTO_TEST_CASE(signal_test_module) {
    fmt::println("signal_test_module");

    
    auto signal = new sh::Signal<int>;

    auto conn1 = signal->connect([](int n){fmt::println("1");});
    auto conn2 = signal->connect([] (int n) {fmt::println("2"); });

    signal->operator()(1);
    conn1->disconnect();
    signal->operator()(2);

    delete signal;

    conn2->disconnect();
}



BOOST_AUTO_TEST_CASE(signal_test_end) {
    fmt::println("signal_test_end");
    getchar();
}

BOOST_AUTO_TEST_SUITE_END()
